home *** CD-ROM | disk | FTP | other *** search
/ Amiga Games: Greatest Hits 1996 / Amiga Games: Greatest Hits 1996.iso / spiele / publicdomain / amigamud-tt / mystuff / readtime.m < prev    next >
Text File  |  1996-07-08  |  2KB  |  74 lines

  1. /*
  2.  * ReadTme.m - Creates a wrist watch object, for sale in the mall,
  3.  * and a town clock, which tells the time.
  4.  * 27/6/96 Tak Tang
  5.  */
  6.  
  7. use t_base.
  8. use t_util.
  9. use t_streets.
  10. use tp_mall.
  11.  
  12. /*****
  13. * Create Wrist watch
  14. *****/
  15.  
  16. define tp_mall proc utility public ReadWatch()string:
  17.   thing me,here;
  18.  
  19.   me   := Me();
  20.   here := Here();
  21.  
  22.   if not me@p_pHidden and CanSee(here, me) then
  23.     OPrint(Capitalize(me@p_pName) + " glances at his wrist\n");
  24.   fi;
  25.   "The time is " + Date() + "."
  26. corp
  27.  
  28. define tp_mall o_watch CreateThing(nil).
  29. o_watch@p_oName := "watch;wrist".
  30. SetThingStatus(o_watch, ts_public).
  31. o_watch@p_oReadAction := ReadWatch.
  32. o_watch@p_oWearString := "You struggle with the cheap strap, and manage to force it on the furthest hole. Loose, but it will stay on.".
  33. o_watch@p_oDesc := "The watch is a cheap mass-produced digital watch. "
  34.   "It is fastened with a tacky black plastic strap with holes too far "
  35.   "apart for a comfortable fit.".
  36. AddObjectForSale(r_mallStore,o_watch,1,nil).
  37. /* Maybe add an alarm feature, and a description */
  38.  
  39.  
  40. /*****
  41. * Create Town Clock
  42. *****/
  43.  
  44. define t_streets proc utility public ReadClock()string:
  45.   thing me,here;
  46.  
  47.   me   := Me();
  48.   here := Here();
  49.  
  50.   if not me@p_pHidden and CanSee(here, me) then
  51.     OPrint(Capitalize(me@p_pName) + " looks up at the clock\n");
  52.   fi;
  53.  
  54.   "The time is " + Date() + "."
  55. corp
  56.  
  57. define t_streets o_clock CreateThing(nil).
  58. o_clock@p_oName := "clock,face;town".
  59. o_clock@p_oReadAction := ReadClock.
  60. o_clock@p_oInvisible := true.
  61. o_clock@p_oNotGettable := true.
  62. o_clock@p_oDesc := "The town clock is brand new.  Its arms sweep across its face like a ballet in slow motion.  The numerals are clearly readable.".
  63. SetThingStatus(o_clock, ts_public).
  64. AddTail(r_ws1@p_rContents, o_clock).
  65. r_ws1@p_rDesc := "The town clock is here.".
  66. /* Maybe add a chime, and code to show people trying to lift it,
  67.  a la Entry-Exit machine, and a description */
  68.  
  69. unuse t_base.
  70. unuse t_util.
  71. unuse t_streets.
  72. unuse tp_mall.
  73.  
  74.